﻿using System;
using System.Globalization;
using System.Windows.Controls;
using System.Windows.Data;
using hStatsC.Views;

namespace hStatsC.Converters
{
    public class PanelNameConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            switch (int.Parse(value.ToString()))
            {
                case 0:
                    return "Dashboard";
                case 1:
                    return "Apps";
                case 2:
                    return "Statistics";
                case 3:
                    return "Versions";
                default:
                    return "Dashboard";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    
    public class PanelContentConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            UserControl view = null;
            switch (int.Parse(value.ToString()))
            {
                case 0:
                    view = new OverviewView();
                    break;
                case 1:
                    view = new AppsView();
                    break;
                case 2:
                    view =new StatisticView();
                    break;
                case 3:
                    view =new AppVersionsView();
                    break; 
            }

            return view;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}